package com.rulin.asp.attachment.service;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

import org.javatuples.Pair;

import com.rulin.asp.attachment.entity.Attachment;

public interface AttachService {

	/**
	 * 上传图片
	 * @param files
	 * @return
	 * @throws IOException 
	 * @throws FileNotFoundException 
	 */
	public List<Attachment> uploadPic(List<Pair<String, InputStream>> files,String areaId) throws FileNotFoundException, IOException;
	
	/**
	 * 导出文件到输出流中
	 * @param address
	 * @param os
	 */
	public void exportToOutputStream(String address, OutputStream os);
	
	/**
	 * 获取附件基本信息
	 * @param address
	 * @return
	 */
	public Attachment getAttachment(String address);
	
	/**
	 * 获取域下所有附件
	 * @param areaId
	 * @return
	 */
	public List<Attachment> getAttachments(String areaId);
	
	/**
	 * 删除附件
	 * @param attachmentId
	 */
	void deleteAttachmentById(String attachmentId);
	
	/**
	 * 复制附件，根据域源id复制到目标域id
	 * @param sourceId
	 * @param destId
	 */
	void copyBySourceAreaId(String sourceAreaId,String destAreaId);
}
